<template>
    <fieldset>
        <modaL :visible='visible' @on-confirm='confirm' @on-cancel='cancel'></modaL>
        <button @click='showModal'>点击显示模态框</button>
    </fieldset>
</template>
<script>
import modaL from '../../assets/modaL'
export default{
    components:{
        modaL,
    },
    data(){
            return {
               visible:false
            }
    },
     methods:{
            showModal(){
                this.visible = true
            },
            cancel(){
                this.visible = false
            },
            confirm(){
                this.visible = false
            }
        }
}
</script>